<template>
  <div class="mv-top-list">
    <ul>
      <li v-for="(item, index) in list" :key="item.id">
        <div class="top-index font-24 mleft-10">
          {{ index + 1 }}
        </div>
        <div class="mtop-10 img-wrap" @click="toMvDetail(item.id)">
          <img :src="item.cover" class="video-img img-border pointer" />
          <div class="video-playcount font-12">
            <i class="iconfont icon-24gl-play"></i>
            {{ item.playCount | countFormar }}
          </div>
          <div class="play-btn pointer">
            <i class="iconfont icon-bofang"></i>
          </div>
        </div>
        <div class="top-info mleft-10">
          <div
            class="title-line text-hidden pointer font-14"
            @click="toMvDetail(item.id)"
          >
            {{ item.name }}
          </div>
          <div class="author-line font-12">
            <span class="mright-10" v-for="at in item.artists" :key="at.id">{{at.name}}</span>
        </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["list"],
  methods:{
    toMvDetail(id){
        this.$router.push('/videodetail/mv/' + id);
    }
  }
};
</script>

<style lang="less" scoped>
.mv-top-list {
  ul {
    display: flex;
    flex-wrap: wrap;
    li {
      display: flex;
      align-items: center;
      width: 49%;
      height: 180px;
    }
  }
}
.top-index {
  width: 50px;
  color: #9f9f9f;
}
.img-wrap {
  position: relative;
  min-width: 200px;
  transition: all 0.5s;
  .video-img {
    height: 150px;
    width: 240px;
    border-radius: 4px;
    transition: all 0.5s;
  }
  .video-playcount {
    color: #ffffff;
    position: absolute;
    right: 10px;
    top: 10px;
    .iconfont {
      font-size: 12px;
    }
  }
  .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fbf6f7;
    width: 40px;
    height: 40px;
    color: #ec4141;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.5s;
    i {
      font-size: 18px;
    }
  }
  &:hover .play-btn {
    opacity: 1;
  }
}
.top-info {
  width: 200px;
  transition: all 0.5s;
  .title-line {
    margin: 4px 0;
  }
  .author-line {
    margin: 2px 0;
    color: #676767;
  }
}
</style>